//
//  LXStatisticsListTableViewCell.m
//  ZuLinProject
//
//  Created by bancheng on 2022/9/5.
//  Copyright © 2022 LX_App. All rights reserved.
//

#import "LXMaintainTableViewCell.h"
#import "LXMainTainModel.h"
#import "LXInsuranceUseModel.h"
#import "LXSalaryModel.h"
@implementation LXMaintainTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self.backView addCorner:4];
    
}


- (void)setModel:(LXMainTainModel *)model{
    _model = model;
    
    self.label1.text = model.carNum;
    
    self.label2.text = [NSString stringWithFormat:@"租车客户          %@",[NSString stringWithNull:model.customerName]];
    [self.label2 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"租车客户" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];

    self.label3.text = [NSString stringWithFormat:@"本次保养      %@",model.intoTime];
    [self.label3 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"本次保养" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label4.text = [NSString stringWithFormat:@"保养金额     %@",[NSString toTen:model.repairAmount]];
    [self.label4 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"保养金额" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label5.text = [NSString stringWithFormat:@"修理厂     %@",model.repairCompanyName];
    [self.label5 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"修理厂" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label6.text = [NSString stringWithFormat:@"下次保养公里数  %@Km",model.nextMiles];
    [self.label6 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"下次保养公里数" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label7.text = [NSString stringWithFormat:@"备注          %@",[NSString stringWithNull:model.remark]];
    [self.label7 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"备注" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label8.text = [NSString stringWithFormat:@"%@Km",model.currentMiles];
    self.label8.textColor = ColorWithFF921C;
    self.label8.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
    
}


- (void)setInsuranceModel:(LXInsuranceUseModel *)insuranceModel{
    _insuranceModel = insuranceModel;
    
    self.label1.text = [NSString stringWithNull:insuranceModel.carNum];
    
    self.label2.text = [NSString stringWithFormat:@"出险时间     %@",insuranceModel.occurrenceTime];
    [self.label2 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"出险时间" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];

    self.label3.text = [NSString stringWithFormat:@"租车客户     %@",[NSString stringWithNull:insuranceModel.customerName]];
    [self.label3 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"租车客户" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label4.text = [NSString stringWithFormat:@"己方金额     %@",[NSString toTen:insuranceModel.selfAmount]];
    [self.label4 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"己方金额" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label5.text = [NSString stringWithFormat:@"第三方金额    %@",[NSString toTen:insuranceModel.thirdAmount]];
    [self.label5 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"第三方金额" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label6.text = [NSString stringWithFormat:@"责任方      %@",[NSString stringWithNull:insuranceModel.chargeSide]];
    [self.label6 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"责任方" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label7.text = [NSString stringWithFormat:@"详细描述     %@",[NSString stringWithNull:insuranceModel.descriptionStr]];
    [self.label7 addAttributes:TextAttrCorlor(ColorWithAAAAAA) forText:@"详细描述" size:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular]];
    
    self.label8.textAlignment = NSTextAlignmentCenter;
    if (insuranceModel.compensateState == 0) {
        self.label8.text = @"处理中";
        self.label8.textColor = ColorWithEA545A;
        self.label8.backgroundColor = [ColorWithEA545A colorWithAlphaComponent:0.1];

    }
    else {
        self.label8.text = @"已完成";
        self.label8.textColor = ColorWith3C6CFC;
        self.label8.backgroundColor = [ColorWith3C6CFC colorWithAlphaComponent:0.1];
    }
    
    
    
}
- (void)setSalaryModel:(LXSalaryModel *)salaryModel{
    _salaryModel = salaryModel;
    
    self.label1.text = [NSString stringWithNull:salaryModel.carNum];
    
    self.label2.text = [NSString stringWithFormat:@"品牌车型    %@",salaryModel.model];
    
    self.label3.text = [NSString stringWithFormat:@"返佣统计时间   %@天",salaryModel.model];
    
    self.label4.text = [NSString stringWithFormat:@"返佣金额   %@",[NSString toTen:salaryModel.amount]];
    
    
    self.label5.text = [NSString stringWithFormat:@"创建时间   %@",salaryModel.createTime.length>10?[salaryModel.createTime substringToIndex:10]:salaryModel.createTime];

    self.label6.text = [NSString stringWithFormat:@"备注   %@",[NSString stringWithNull:salaryModel.remark]];

    
}
@end
